using UnityEditor;

[CustomEditor(typeof(LineTransform))]
public class LineTransformEditor : Editor
{
    public override void OnInspectorGUI()
    {
        if (EditorApplication.isPlaying)
        {
            EditorGUI.BeginDisabledGroup(true);
        }

        base.OnInspectorGUI();

        if (EditorApplication.isPlaying)
        {
            EditorGUI.EndDisabledGroup();
        }

        if (!EditorApplication.isPlaying) return;
        
        var t = target as LineTransform;
        if (!t) return;
        t.controlCriteria = EditorHelper.DisplayDelegate(t.controlCriteria, "Control Criteria");
        t.onLanded = EditorHelper.DisplayDelegate(t.onLanded, "On Landed");
        t.onLeavingLand = EditorHelper.DisplayDelegate(t.onLeavingLand, "On Leaving Land");
    }
}